Consider the language L given by the regular expression (a + b) *b(a +...

In the STT below you can see 4 states are there but before confirming the ans lets try to minimize, It cant be minimized further because A goes to Nonfinal Nonfinal & AB goes to Final Final hence can not be merged. Similarly ∗AC goes NF NF & ∗ABC goes to F F hence can not be merged. Hence, 4 is the final answer.

View all questions of this test
Consider the language L given by the regular expression (a + b) *b(a +...
Solution:
The given regular expression is (a b)*b(a b).
We need to find the smallest number of states needed in a DFA accepting L.
We can construct a DFA for L as follows:
1. Start with an initial state q0.
2. For each input symbol a, create a transition from q0 to a new state q1, labeled with a.
3. For each input symbol b, create a transition from q0 to q2, labeled with b.
4. For each input symbol a, create a transition from q1 to q2, labeled with a.
5. For each input symbol b, create a transition from q1 to q3, labeled with b.
6. For each input symbol a, create a transition from q2 to q1, labeled with a.
7. For each input symbol b, create a transition from q2 to q2, labeled with b.
8. For each input symbol a, create a transition from q3 to q2, labeled with a.
9. For each input symbol b, create a transition from q3 to q3, labeled with b.
10. Mark q3 as the final state.
The DFA constructed above has 4 states.
Therefore, the smallest number of states needed in a DFA accepting L is 4.
Hence, option B is the correct answer.